<%@ page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>设备以及备件信息</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
</head>
<body>
	<div class="subtitle">
		<input id="id" name="id" type="hidden" value="${zyEquipmentSparePage.id }">
		<p>设备信息</p>
		<table class="nobordertable noborder">
			<tr>
				<td class="al_r" width="20%">
					<label>序列号:</label>
				</td>
				<td width="20%">
					<span>${zyEquipmentSparePage.sn}</span>
				</td>
				<td class="al_r" width="30%">
					<label>设备型号:</label>
				</td>
				<td width="30%">
					<span>${zyEquipmentSparePage.item }</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>安装日期:</label>
				</td>
				<td>
					<span><fmt:formatDate  value="${zyEquipmentSparePage.installDate }" type="both" pattern="yyyy-MM-dd" /></span>
				</td>
				<td class="al_r">
					<label>发货日期:</label>
				</td>
				<td>
					<span><fmt:formatDate  value="${zyEquipmentSparePage.sendDate }" type="both" pattern="yyyy-MM-dd" /></span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>服务状态:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.serverStateVal } </span>
				</td>
				<td class="al_r">
					<label>机型:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.type.typeDesc }</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>是否异常:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.isNormal == 'true'?'是':'否' } </span>
				</td>
				<td class="al_r">
					<label>异常原因:</label>
				</td>
				<td>
					<%-- <textarea id="exceptionReason" name="exceptionReason" cols="20" rows="5" readonly="readonly" >${zyEquipmentSparePage.exceptionReason }</textarea> --%>
					<span>${zyEquipmentSparePage.exceptionReason }</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>最后更新日期：</label>
				</td>
				<td>
					<span><fmt:formatDate  value="${zyEquipmentSparePage.updateDate }" type="both" pattern="yyyy-MM-dd" /></span>
				</td>
				<td class="al_r">
					<label>备注:</label>
				</td>
				<td>
					<%-- <textarea id="remarks" name="remarks" cols="20" rows="5" readonly="readonly" >${zyEquipmentSparePage.remarks }</textarea> --%>
					<span>${zyEquipmentSparePage.remarks}</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>派单指示：</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.sendSign.departname}</span>
				</td>
				<td class="al_r">
					<label>院线:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.cinema}</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>是否序列号追踪：</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.isSerialnumTrack == '1'?'是':'否' } </span>
				</td>
				<td class="al_r">
					<label>版本信息:</label>
				</td>
				<td>
					${zyEquipmentSparePage.vcreateDate}&nbsp;&nbsp;&nbsp;放映机软件版本：${zyEquipmentSparePage.v1}&nbsp;&nbsp;&nbsp;ICP/TI/ICMP软件版本:${zyEquipmentSparePage.v2}
				</td>
			</tr>
		</table>
	</div>
	<div class="subtitle">
		<p>SLA信息</p>
		<table class="nobordertable noborder">
			<tbody>
			<tr>

				<td class="al_r" width="20%">
					<label>服务起止时间:</label>
				</td>
				<td width="30%">
					${slaList1.warranty_begin_date}~${slaList1.REPAIR_END_DATE}
				</td>
				<td class="al_r" width="20%">
					<label>服务商:</label>
				</td>
				<td width="30%">
					<span id="slashortname">${slaList1.shortname}</span>&nbsp;&nbsp;${slaList1.repairType}
				</td>

			</tr>
			<tr>

				<td class="al_r" width="20%">
					<label>年度巡检次数:</label>
				</td>
				<td width="30%">
					${slaList1.s1}
				</td>
				<td class="al_r" width="20%">
					<label>工程师级别要求:</label>
				</td>
				<td width="30%">
					${slaList1.s2}
				</td>
			</tr>
			<tr>

				<td class="al_r" width="20%">
					<label>特别服务承诺:</label>
				</td>
				<td width="30%">
					${slaList1.SERVICECOMMITMENT}
				</td>
				<td class="al_r" width="20%">
					<label>巡检光路:</label>
				</td>
				<td width="30%">
					${slaList1.s3}
				</td>
			</tr>
			<tr>
				<td class="al_r" width="20%">
						<label>SLA增减项:</label>
				</td>
				<td width="30%">
					${slaList1.supplement}
				</td>
				<td class="al_r" width="20%">
					<label>是否含硬盘维修:</label>
				</td>
				<td width="30%">
					${slaList1.s4}
				</td>
			</tr>
			</tbody>
		</table>
	</div>
	<div class="subtitle">
		<p>维保信息</p>
		<table class="nobordertable noborder">
			<tr>
				<td class="al_r" width="20%">
					<label>保修开始日期：</label>
				</td>
				<td width="20%">
					<span><fmt:formatDate  value="${zyEquipmentSparePage.warrantyBeginDate }" type="both" pattern="yyyy-MM-dd" /></span>
				</td>
				<td class="al_r" width="30%">
					<label>保修期(年)：</label>
				</td>
				<td width="30%">
					<span>${zyEquipmentSparePage.repairDate}</span>
				</td>
<%--				<td class="al_r" width="20%">--%>
<%--					<label>保修期:</label>--%>
<%--				</td>--%>
<%--				<td width="20%">--%>
<%--					<span><fmt:formatDate  value="${zyEquipmentSparePage.baseRepairDate }" type="both" pattern="yyyy-MM-dd" /></span>--%>
<%--				</td>--%>
<%--				<td class="al_r" width="30%">--%>
<%--					<label>销售合同保修期截止日:</label>--%>
<%--				</td>--%>
<%--				<td width="30%">--%>
<%--					<span><fmt:formatDate  value="${zyEquipmentSparePage.repairEndDate }" type="both" pattern="yyyy-MM-dd" /></span>--%>
<%--				</td>--%>
			</tr>
			<tr>
<%--				<td class="al_r">--%>
<%--					<label>是否已维护保期:</label>--%>
<%--				</td>--%>
<%--				<td>--%>
<%--					<span>${zyEquipmentSparePage.isServicing eq '1'?'已维护':'未维护'}</span>--%>
<%--				</td>--%>
				<td class="al_r">
					<label>保期截止日期:</label>
				</td>
				<td>
					<span><fmt:formatDate  value="${zyEquipmentSparePage.repairEndDate }" type="both" pattern="yyyy-MM-dd" /></span>
				</td>
				<td class="al_r">
					<label>续保方：</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.companyOfRenewal}</span>
				</td>
			</tr>
		</table>
	</div>
	<div class="subtitle">
		<p>归属信息</p>
		<table class="nobordertable noborder">
			<tr>
				<td class="al_r" width="20%">
					<label>所在影院:</label>
				</td>
				<td width="20%">
					<span>${zyEquipmentSparePage.zyCinema.name}</span>
				</td>
				<td class="al_r" width="30%">
					<label>影院地址:</label>
				</td>
				<td width="30%">
					<span>${zyEquipmentSparePage.zyCinema.address}</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>厅号:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.house.roomNum}</span>
				</td>
				<td class="al_r">
					<label>BP号:</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.bpNo }</span>
				</td>
			</tr>
			<tr>
				<td class="al_r">
					<label>所属机构(院线):</label>
				</td>
				<td>
					<span>${zyEquipmentSparePage.tsDepart.shortname}</span>
				</td>
				<td></td>
				<td></td>
			</tr>
		</table>
	</div>
	<div class="subtitle" >
		<p>备件信息列表</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="zySpareList" fitColumns="false" 
			actionUrl="zyEquipmentSpareController.do?datagridForTopItem&topItemSn=${zyEquipmentSparePage.sn}" idField="id" fit="false" queryMode="group"  pagination="false">
			<t:dgCol title="主键"			field="id"		hidden="true"	width="120" />
			<t:dgCol title="备件SN"			field="sn"						width="200" />
			<t:dgCol title="备件Item"		field="item"					width="200" />
			<t:dgCol title="备件类型"		field="type.typeDesc"			width="200" />
			<t:dgCol title="是否异常"		field="isNormal"				width="100"		dictionary="<%=StaticValue.DIC_TRUE_OR_FALSE_NUM %>"/>
			<t:dgCol title="备注"			field="remarks"					width="300"		/>
		</t:datagrid>
	</div>
	<div class="subtitle" >
		<p>安装记录</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="ZyInstallRecordList" checkbox="false" fitColumns="false" 
			actionUrl="zyInstallRecordController.do?datagrid&sn=${zyEquipmentSparePage.sn}" idField="id" fit="false" queryMode="group" pagination="false" onLoadSuccess="installRecordLoadSuccess">
			<t:dgCol title="主键"				field="id"	hidden="true"	queryMode="single"  width="120"/>
			<t:dgCol title="编号"				field="no"					queryMode="single"	query="false"	width="100"/>
			<t:dgCol title="序列号"				field="sn"					queryMode="single"	query="false"	width="100"/>
			<t:dgCol title="型号"				field="dpModel"				queryMode="single"	query="false"	width="100"/>
			<t:dgCol title="省"					field="province"			queryMode="single"	query="false"	width="40"	/>
			<t:dgCol title="市"					field="city"				queryMode="single"	query="false"	width="40"	/>
			<t:dgCol title="计划到货日期"			field="customerPlanedArrivalDate"   queryMode="single"	query="false"	width="90"		formatter="yyyy-MM-dd"/>
			<t:dgCol title="实际发货日期"			field="actualSendDate"    	queryMode="single"	query="false"	width="90"		formatter="yyyy-MM-dd"/>
			<t:dgCol title="发货地"				field="sendPlace"    		queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="所属经销商"			field="belongDealer"    	queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="影院名称"			field="cnCustomerName"    	queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="地址"				field="cnAddress"    		queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="联系人"				field="contacter"    		queryMode="single"	query="false"	width="50"	/>
			<t:dgCol title="联系人电话"			field="telNo"    			queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="所在厅号"			field="house"    			queryMode="single"	query="false"	width="55"	/>
			<t:dgCol title="安装日期"			field="installedDate"    	queryMode="single"	query="false"	width="90"		formatter="yyyy-MM-dd"/>
			<t:dgCol title="保期"				field="warrantyPeriod"    	queryMode="single"	query="false"	width="120"	/>
			<t:dgCol title="BP"					field="bpNo"			hidden="true"	queryMode="single"	query="false"	width="120"/>
			<t:dgCol title="创建人名称"			field="createName"		hidden="true"	queryMode="single"  width="120"/>
			<t:dgCol title="创建人登录名称"		field="createBy"		hidden="true"	queryMode="single"  width="120"/>
			<t:dgCol title="创建日期"			field="createDate"		hidden="true"	formatter="yyyy-MM-dd"	queryMode="single"  width="120"/>
			<t:dgCol title="更新人名称"			field="updateName"		hidden="true"	queryMode="single"	width="120"/>
			<t:dgCol title="更新人登录名称"		field="updateBy"		hidden="true"	queryMode="single"	width="120"/>
			<t:dgCol title="更新日期"			field="updateDate"		hidden="true"	formatter="yyyy-MM-dd"	queryMode="single"  width="120"/>
			<%-- <t:dgCol title="操作"	field="opt" width="100"/>
			<t:dgFunOpt funname="viewDetail" title="查看" ></t:dgFunOpt> --%>
		</t:datagrid>
	</div>
	<div class="subtitle">
		<p>巡检记录</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="zyGenerateInspectionPlanList" checkbox="false" fitColumns="false" 
			actionUrl="zyInspectionPlanController.do?datagridOfEquipmentDetails&sn=${zyEquipmentSparePage.sn}" idField="id" fit="false" queryMode="group"  pagination="false" onLoadSuccess="reportListLoadSuccess">
			<t:dgCol title="主键"			field="id"  	hidden="true"	queryMode="single"  width="120"/>
			<t:dgCol title="巡检计划ID"		field="plan_id"				width="100" funname="planDetials"/>
			<t:dgCol title="巡检结束时间"	field="actual_date"		width="100" formatter="yyyy-MM-dd"/>
			<t:dgCol title="巡检单位"		field="company"				width="100" />
			<t:dgCol title="巡检工程师"		field="engineer"			width="100" />
			<t:dgCol title="所在影厅"		field="house"				width="90" />
			<t:dgCol title="温度"			field="yt_rm_temperature"	width="130" />
			<t:dgCol title="湿度"			field="yt_rm_humidity"		width="100"	/>
			<t:dgCol title="冷却液面高度(ML)"	field="lq_coolant_liquid_h"	width="130"	/>
			<t:dgCol title="冷却液压力(Pa)"	field="lq_score_coolant"	width="70" />
			<t:dgCol title="排风管口风速"		field="lq_vent_speed"		width="100" />
			<t:dgCol title="防尘滤网"		field="qj_dust_filter_cl_mp"	width="150"	/>
			<t:dgCol title="零地电压(V)"		field="xl_zero_voltage"		width="90" />
			<t:dgCol title="灯运行时间(小时)"	field="xd_run_time"			width="110" />
			<t:dgCol title="点灯次数"		field="xd_run_count"		width="110" />
			<t:dgCol title="光路"			field="gx_light_path"		width="110" dictionary="<%=StaticValue.DIC_LIGHT_PATH %>"/>
			<t:dgCol title="维护后亮度"		field="yx_light_c"			width="110" />
			<t:dgCol title="机器总运行时间"	field="total_run_time"		width="110" />
			<t:dgCol title="维护后评分"		field="after_score"			width="110" />
			<t:dgCol title="ENG 序列号"		field="eng_item_sn"			width="110" />
			<t:dgCol title="TI / ICP 系列号"	field="ti_icp_item_sn"		width="110" />
			<t:dgCol title="LPS序列号"		field="lps_item_sn"			width="210" />
			<t:dgCol title="Enigma序列号"	field="enigma_item_sn"		width="110" />
			<t:dgCol title="控制板序列号"		field="controler_item_sn"	width="110" />
			<t:dgCol title="SMPS序列号"		field="smps_item_sn"		width="110" />
			<t:dgCol title="服务器品牌"		field="server_brand"		dictionary="zy_equipment_type,id,type_desc" width="110" />
			<t:dgCol title="型号/序列号"		field="server_model"		width="110" />
			<t:dgCol title="工程师建议及评价"	field="comprehensive_evaluation"  width="310"/>
		</t:datagrid>
	</div>
	<div class="subtitle" >
		<p>保期记录</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="ZyWarrantyPeriodRecordList" checkbox="false" fitColumns="false" 
			actionUrl="cbsContractMcEquipmentController.do?datagrid&sn=${zyEquipmentSparePage.sn}" idField="id" fit="false" queryMode="group" pagination="false" onLoadSuccess="wpRecordLoadSuccess">
			<t:dgCol title="主键"			field="id"	hidden="true"	queryMode="single"  width="120"/>
			<t:dgCol title="服务合同号"		field="contractCode"	queryMode="single"  width="180"/>
			<t:dgCol title="影院名称"			field="cinemaName"	queryMode="single"	query="false"  width="300"/>
			<t:dgCol title="合同生效时间"		field="contractDate" formatter="yyyy-MM-dd" queryMode="single"	query="false"  width="120"/>
			<t:dgCol title="付款时间"		field="payDate" formatter="yyyy-MM-dd" queryMode="single"	query="false"  width="120"/>
		   	<t:dgCol title="状态"			field="status" queryMode="single"	query="false"  width="80"  dictionary="<%=StaticValue.mc_status %>"/>
		   	<t:dgCol title="合同开始日"		field="serviceStartDate"	hidden="false"	formatter="yyyy-MM-dd"	queryMode="single"	query="false"  width="120"/>
		   	<t:dgCol title="合同结束日"		field="serviceEndDate"	hidden="false"	formatter="yyyy-MM-dd"		queryMode="single"	query="false"  width="120"/>
		   	<t:dgCol title="合同负责人"			field="signUser" queryMode="single"	query="false"  width="80"/>
		   	<t:dgCol title="ERP系统单号"			field="mcCode" queryMode="single"	query="false"  width="120"/>
		</t:datagrid>
	</div>
	<div class="subtitle">
		<p>服务单历史记录</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="cbsServiceList" fitColumns="false" actionUrl="cbsServiceController.do?datagrid&sn=${zyEquipmentSparePage.sn }" idField="id"
					fit="true" pagination="false" onLoadSuccess="zyCbsServiceListSuccess">
			<t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"/>
			<t:dgCol title="服务单号" field="code" width="160" url="cbsServiceController.do?detail&id={id}" funname="CbsserviceDetials"/>
			<t:dgCol title="设备SN" field="sn" width="120"/>
			<t:dgCol title="服务类型" field="serviceType2" width="120" dictionary="<%=StaticValue.Source_State %>"/>
			<t:dgCol title="服务状态" field="status" width="120" dictionary="<%=StaticValue.Source_State %>"/>
			<t:dgCol title="服务商" field="serviceProvider" width="80"/>
			<t:dgCol title="服务商处理进度" field="speedstatus" width="120" dictionary="<%=StaticValue.Third_Party_Processing_Progress %>"/>
			<t:dgCol title="创建时间" field="createDate" width="120" formatter="yyyy-MM-dd"/>
			<t:dgCol title="关单时间" field="closeTime" width="120" formatter="yyyy-MM-dd"/>
		</t:datagrid>
	</div>
	<%--<div class="subtitle" >
		<p>服务单历史记录</p>
	</div>
	<div class="datagridDiv" style="height: 200px;overflow-x: scroll;">
		<t:datagrid name="zySpareRecordList" checkbox="false" fitColumns="false"
			actionUrl="zySpareRecordController.do?datagrid&sn=${zyEquipmentSparePage.sn}" idField="id" fit="false" queryMode="group"  pagination="false" onLoadSuccess="reportListLoadSuccess">
			<t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="设备SN"  field="equipmentSn"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="影院"  field="cinemaId.name"    queryMode="single"   width="120"></t:dgCol>
			<t:dgCol title="备件描述"  field="spareDesc.typeDesc"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="旧备件备件号"  field="oldSpareNo"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="旧备件序列号SN"  field="oldSpareSn"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="更换日期"  field="replaceDate"  formatter="yyyy-MM-dd"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="新备件备件号"  field="newSpareNo"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="新备件序列号SN"  field="newSpareSn"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="更换原因"  field="replaceReason"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="备注"  field="remark"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="关联服务单据号"  field="relationServiceNo"    queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="创建人登录名称"  field="createBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="更新人名称"  field="updateName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
			<t:dgCol title="更新日期"  field="updateDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
		</t:datagrid>
	</div>--%>

	<script type="text/javascript">
		$(function(){
<%--				$("#zySpareList").datagrid('resize',{height : 500,width: 1024});--%>
<%--				$("#ZyInstallRecordList").datagrid('resize');--%>
<%--				$("#zyGenerateInspectionPlanList").datagrid('resize');--%>
<%--				$("#ZyWarrantyPeriodRecordList").datagrid('resize');--%>
			setTimeout(function(){
				var minHeight = 200;
				$(".datagridDiv").each(function(){
					var height = $(this).find(".panel.datagrid").height() + 20;//20富余空间
					if(height > minHeight){
						$(this).height(height);
					}
				});
			},2000);
		});
		function spareLoadSuccess(){
			reziseDatagridInViewPage("zySpareList","datagridDiv",200);
		}
		function installRecordLoadSuccess(){
			reziseDatagridInViewPage("ZyInstallRecordList","datagridDiv",200);
		}
		function reportListLoadSuccess(){
			reziseDatagridInViewPage("zyIpReportList","datagridDiv",200);
		}
		function wpRecordLoadSuccess(){
			reziseDatagridInViewPage("ZyWarrantyPeriodRecordList","datagridDiv",200);
	        var trs = $("#ZyWarrantyPeriodRecordList").prev().find('div.datagrid-body').find('tr');
	        for (var i = 0; i < trs.length; i++) {

	            for (var j = 0; j < 10; j++) {
	                 if (trs[i].cells[j].firstChild.innerHTML =='生效中' ){
	                    trs[i].cells[j].style.cssText = 'color:red';
	                }
	            }
	        }
		}

        function CbsserviceDetials(filedName,url){
            var datas = $("#cbsServiceList").datagrid("getSelections");
            var code = datas[0].code;
            addOneTab("服务单详情"+code, url);
        }
	</script>
</body>
